#include "../inc/Drawable.h"

void Drawable::renderRotation() 
{ 
     glRotatef( getRotation().x, 1, 0, 0 );
     glRotatef( getRotation().y, 0, 1, 0 );
     glRotatef( getRotation().z, 0, 0, 1 );
}

void Drawable::renderTranslation()
{ 
     glTranslatef( getPos().x, getPos().y, getPos().z );
}

void Drawable::rotate ( CoordF r )
{
     cRot += r;
     
     // Corrige amplitude de valores
     while (cRot.x < -360.0) cRot.x += 360.0;
     while (cRot.y < -360.0) cRot.y += 360.0;
     while (cRot.z < -360.0) cRot.z += 360.0;
     while (cRot.x > 360.0) cRot.x -= 360.0;
     while (cRot.y > 360.0) cRot.y -= 360.0;
     while (cRot.z > 360.0) cRot.z -= 360.0;
     
}
